-
Notifications
You must be signed in to change notification settings - Fork 3
Converts the repository into a proper python package #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Converts the repository into a proper python package #3
Conversation
…alled and imported. Adds scripts for fetching protobuf files from DFHack git repo, and generating the python protobuf files for the client to use. Fleshes out the README with for detailed instructions using the newly added scripts.
…on from CoreProtocal and one from the RemoteFortressReader plugin. Properly imports protobuff types from the _pb2 files.
- Introduced DFHackError class for better error management in DFHack commands. - Enhanced get_header function to handle RPC_REPLY_FAIL and raise DFHackError. - Updated remote function to process RPC_REPLY_TEXT and RPC_REPLY_RESULT messages and log text notifications to standard output. - Adjusted byte size handling in get_header for consistency (python slice is non inclusive for the end).
…he from async_lru. This fixes a bug where the cache was storing coroutines instead of the final result of the function execution which caused an issue whenever you called the same method twice in one session.
…s to EmptyMessage, same as input type)
|
Thanks for the PR! Looks great. |
Hey @McArcady, thanks for taking a look. I would be happy to maintain it! I haven't tested it on Linux yet but I plan to do that next. |
… in the actual value of the input instead of the type when making the RPC call
…t object, as well as to have a slightly cleaner @Remote annotaion structure.
Outline
Details
This new project structure separates the python protobuf generation from the resulting
dfhack_client_pythonpackage which can be installed usingpipand used by a client application../cmake/contains theCMakeLists.txtand also temporarily houses the intermediate cmake/make files that get generated when generating the protobuf python code../examples/contains theblendwarf.pyfile. This is a good example for howdfhack_client_pythoncan be imported and used../proto/<tag>/contains all proto files for the<tag>version of DFHack. These files are not necessary for the package to work but are a useful reference when using the client../scripts/contains:fetch_proto_files.py- a convenient script for automating the .proto file retrieval for a given DFHack<tag>.generate_python.py- a convenient script for automating the generation of protobuf python code necessary for the package to work (still using cmake and make). This script should work on both Linux and Windows../src/dfhack_client_python/contains thepy_export/directory (with its generated protobuf python files) and thedfhack_remote.pycore package file.pyproject.tomlcontains the package definitionREADME.mdwas updated to explain how to generate protobuf python files for other/new DFHack versions and how to install/use thedfhack_client_pythonpackage